#include "Parameters.h"
#include <iostream>
#include <fstream>

int Parameters::values_[2];

/**
    Order of items in the file:

    screen width
    screen height
*/
void Parameters::Load()
{
    std::ifstream fin("parameters.txt");

    if (fin.is_open())
    {
        std::cout << "File opened succesfully." << std::endl;
        for (int i = 0; i < 2; i++)
        {
            while (fin.get() != '=')
                continue;

            fin >> values_[i];
        }
    }
    fin.clear();
    fin.close();
}

const unsigned Parameters::GetScreenWidth()
{
    return values_[0];
}

const unsigned Parameters::GetScreenHeight()
{
    return values_[1];
}
